//
//  WYCRechargeController.m
//  51信用卡
//
//  Created by 中企互联 on 2017/11/2.
//  Copyright © 2017年 中企互联. All rights reserved.
//

#import "WYCRechargeController.h"
#import "WYCRechargeBankController.h"


@interface WYCRechargeController ()

@end

@implementation WYCRechargeController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //setupNav
    [self setupNav];
    
    //创建界面
    [self setupCreat];
}

#pragma make ------->>创建界面
- (void)setupCreat{
    CGFloat tableviewY = CGRectGetMaxY(self.navigationController.navigationBar.frame);
    
    //背景图
    UIView * backView = [[UIView alloc] init];
    backView.frame = CGRectMake(0, tableviewY, ScreenWidth, 400 * px);
    backView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:backView];
    
    
    
    //卡选择
    UILabel *cardlabel = [[UILabel alloc] init];
    cardlabel.frame = CGRectMake(40 * px, 40 * px, ScreenWidth / 5 * 4, 60 * px);
    cardlabel.font = MiddleLight;
    cardlabel.text = @"银行卡： 建设银行（4678）储蓄卡";
    [backView addSubview:cardlabel];
    
    
    UIButton * pushbutton = [[UIButton alloc] init];
    pushbutton.frame = CGRectMake(ScreenWidth - 80 * px, cardlabel.y, 40 * px, cardlabel.height);
    [pushbutton setImage:[UIImage imageNamed:@"right_push"] forState:UIControlStateNormal];
    [pushbutton addTarget:self action:@selector(pushButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [backView addSubview:pushbutton];
    
    
    //建设银行下面的线
    UIView * lineView = [[UIView alloc] init];
    lineView.frame = CGRectMake(cardlabel.x, CGRectGetMaxY(cardlabel.frame) + 40 * px, ScreenWidth - cardlabel.x, 1);
    lineView.backgroundColor = WYCGlobalBg;
    [backView addSubview:lineView];
    
    
    //$
    UILabel *maneylabel = [[UILabel alloc] init];
    maneylabel.frame = CGRectMake(40 * px, CGRectGetMaxY(lineView.frame) + 80 * px, 70 * px, 60 * px);
    maneylabel.font = MiddleLight;
    maneylabel.text = @"¥";
    [backView addSubview:maneylabel];
    
    UITextField *maneyField = [[UITextField alloc] init];
    maneyField.frame = CGRectMake(CGRectGetMaxX(maneylabel.frame) + 40 * px, maneylabel.y, ScreenWidth, maneylabel.height);
    maneyField.placeholder = @"输入充值额度";
    maneyField.font = MiddleLight;
    [backView addSubview:maneyField];
    
    
    //提示
    UILabel *showlabel = [[UILabel alloc] init];
    showlabel.frame = CGRectMake(40 * px, CGRectGetMaxY(backView.frame) + 80 * px, ScreenWidth, 60 * px);
    showlabel.font = smallLight;
    showlabel.textColor = WYZGrayBg;
    showlabel.text = @"每笔充值收取0.85%的手续费";
    [self.view addSubview:showlabel];
    
    
    
    //提交按钮
    UIButton * saveButton = [[UIButton alloc] init];
    saveButton.frame = CGRectMake(40 * px, CGRectGetMaxY(showlabel.frame) + 300 * px, ScreenWidth - 80 * px, 150 * px);
    [saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    saveButton.layer.cornerRadius = 5;
    [saveButton addTarget:self action:@selector(saveButtonClick) forControlEvents:UIControlEventTouchUpInside];
    saveButton.backgroundColor = WYCMain;
    saveButton.titleLabel.font = MiddleLight;
    [saveButton setTitle:@"确认充值" forState:UIControlStateNormal];
    [self.view addSubview:saveButton];
}
#pragma make ------->>setupNav
- (void)setupNav {
    self.navigationItem.title = @"充值";
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    [self.navigationController.navigationBar setBarTintColor:WYCMain];
    
    self.view.backgroundColor = WYCGlobalBg;
}
#pragma make -------->>确认充值事件
- (void)saveButtonClick{
    WYCLogFunc;
    
}


#pragma make -------->>选择卡片
- (void)pushButtonClick{
    
    WYCLogFunc;
    WYCRechargeBankController * rechargebank = [[WYCRechargeBankController alloc] init];
    [self.navigationController pushViewController:rechargebank animated:NO];
}
@end
